# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Orson Teodoro <orsonteodoro@hotmail.com>
# Maintainer: Orson Teodoro <orsonteodoro@hotmail.com>
pkgname=surf
pkgver=2.1
pkgrel=2
pkgdesc="surf is a simple web browser based on WebKit2/GTK+."
url="https://surf.suckless.org/"
arch="all"
license="MIT"
depends="xprop"
makedepends="webkit2gtk-4.1-dev gcr-dev"
subpackages="$pkgname-doc"
options="!check" # upstream doesn't have a test suite
source="surf-$pkgver.tar.gz::https://dl.suckless.org/surf/surf-$pkgver.tar.gz
	webkit2gtk-4.1.patch
	"

provides="surf-virtual"
provider_priority=100

prepare() {
	default_prepare
	sed -i -e '/CFLAGS/{s/-Os//;s/=/+=/}' \
		-e '/LDFLAGS/{s/-s//;s/=/+=/}' \
		"$builddir"/config.mk
}

build() {
	make
}

package() {
	make DESTDIR="$pkgdir" PREFIX="/usr" install

	mkdir -p "$pkgdir"/usr/share/doc/$pkgname
	install -m644 README TODO.md \
		"$pkgdir"/usr/share/doc/$pkgname
}

sha512sums="
06f31f683a941d9a587d908ae7f6949255937b0b0c9c133a18c6fa753c7da75de267adda1c83dd9ba0a8535e2b6d4ff2b5408cc5e8a2e315d4198fe68df5db12  surf-2.1.tar.gz
d0492cf019899158029396afd35a9e241a8859fa86536d5aff8bf77ebb1396922358d87bf2355aba216d0ade6ffff05edab6078fa66f7542e9a1ec98f45b435f  webkit2gtk-4.1.patch
"
